package com.zretc.common.entity;

public class R {
    private final static Integer S_CODE = 200;
    public static<D> RespResult success(D data){

        return genRespObj(200,"请求成功",data);
    }
    public static<D> RespResult fail(Integer code,String msg){

        return genRespObj(code,msg,null);
    }


    public static<D> RespResult genRespObj(Integer code , String msg , D data){

        return new RespResult(code,msg,data);
    }

    public static<D> RespResult authenticationException(D data){

        return genRespObj(403,"认证错误",data);
    }
    public static<D> RespResult accessException(D data){

        return genRespObj(405,"权限不足",data);
    }


}
